# import math
# print(max(1,'20',8,5))
a = 1
b = 2

# 利用第三方变量
c = a
a = b
b = c
# print('a的值是{},b的值是{}'.format(a, b))
print(a, b)

a = 1
b = 2
# 第二种 不能用第三方变量
a = a + b  # a --> 3
b = a - b  # b --> 1
a = a - b  # a --> 2

print(type(a))

print('a的值是{},b的值是{}'.format(a, b))
a = 1
b = 2
# 异或 (异或两次就是他本身)
a = a ^ b
b = a ^ b
a = a ^ b
print('a的值是{},b的值是{}'.format(a, b))

# 直接交换
a = 1
b = 2
a, b = b, a
print('a的值是{},b的值是{}'.format(a, b))

print("----------异或------------")
print(7 ^ 3)
a = 7
b = 3

print(bin(a))
print(bin(b))

c = 0b10011
d = 0b01110
# d=0b01110
#     11101
print(c, d)
e = c ^ d
print('c和d的异或结果为:', e)

print(0b11101)

